<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const arr = [1, 2, 3];
      // 展开运算符可以展开数组
      // ...arr = 1,2,3
      console.log(...arr);
      console.log(Math.max(...arr)); // 最大值 3
      console.log(Math.min(...arr)); // 最小值 1

      // 合并数组
      const arr1 = [1, 2, 3];
      const arr2 = [4, 5, 6];
      const arr3 = [...arr1, ...arr2];
      console.log(arr3); // [1,2,3,4,5,6]
    </script>
  </body>
</html>
